<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>校友交流系统</title>
    <!-- 引入Bootstrap CSS -->
    <link rel="stylesheet" href="asset/bootstrap-5.3.0-alpha1-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="asset/css/nav.css">
    <style>
        .card {
            transition: transform 0.3s ease; /* 添加过渡效果 */
            overflow: hidden; /* 确保内容溢出时隐藏 */
        }

        .card:hover {
            transform: scale(1.05); /* 卡片悬停时放大 */
            box-shadow: 0 10px 20px rgba(0,0,0,0.2); /* 增加阴影效果 */
        }

        .card-body {
            transition: height 0.3s ease; /* 卡片内容高度过渡效果 */
            height: 140px; /* 初始高度 */
        }

        .card:hover .card-body {
            height: 200px; /* 悬停时增加高度 */
        }

        .card-text {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2; /* 限制文本行数 */
            -webkit-box-orient: vertical;
        }

        .card:hover .card-text {
            -webkit-line-clamp: 5; /* 悬停时显示更多文本行 */
        }
    </style>
</head>
<body>
<!-- 导航栏 -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">校友交流系统</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link active" aria-current="page" href="index.html">首页</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="views/xiaoyou_minglu.html">校友名录</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="views/xiaoyyou_xiangqin.html">校友相亲</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="views/xiaoyou_juanzeng.html">捐赠信息</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="views/xiaoyou_luntan.html">校友论坛</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="views/call_us.html">联系我们</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<!-- 主体内容 -->
<div class="container mt-4">
    <div class="row">
        <div class="col-md-4">
            <div class="card shadow" style="width: 24rem;">
                <div class="card-body">
                    <h5 class="card-title">校友相亲</h5>
                    <p class="card-text">查看单身的校友们: ）</p>
                    <div class="card-content">
                        <p>校友相亲包括在此网站上发布相亲信息的校友，嘻嘻嘻</p>
                    </div>
                    <a href="views/xiaoyyou_xiangqin.html" class="btn btn-primary">查看更多</a>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card shadow" style="width: 24rem;">
                <div class="card-body">
                    <h5 class="card-title">校友名录</h5>
                    <p class="card-text">浏览校友名录，寻找老朋友。</p>
                    <div class="card-content">
                        <p>名录涵盖了不同年代的毕业生信息，帮助你找到昔日同学和朋友。</p>
                    </div>
                    <a href="views/xiaoyou_minglu.html" class="btn btn-primary">查看更多</a>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card shadow" style="width: 24rem;">
                <div class="card-body">
                    <h5 class="card-title">捐赠信息</h5>
                    <p class="card-text">了解校友捐赠项目，为母校贡献力量。</p>
                    <div class="card-content">
                        <p>捐赠项目包括奖学金设立、校园建设、科研支持等。</p>
                    </div>
                    <a href="views/xiaoyou_juanzeng.html" class="btn btn-primary">查看更多</a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container mt-5 pt-5">
    <!--  记忆墙-->
    <div class="row">
        <div class="card ">
            <div class="row text-center align-content-center mt-3">
                <h3 style="color: #0ABAB5;">农大记忆墙</h3>
            </div>
            <div class="row align-content-center text-center">
                <div id="memoryWall" style="width: 100%;height: 400px;"></div>
            </div>
        </div>
    </div>

<!--    &lt;!&ndash;时间线&ndash;&gt;-->
<!--    <div class="row mt-5 ">-->
<!--        <div class="card">-->
<!--            <div class="row text-center align-content-center mt-3">-->
<!--                <div id="timeline" style="width: 100%;height: 400px;"></div>-->
<!--            </div>-->
<!--        </div>-->

<!--    </div>-->

</div>


<!-- 页脚 -->
<footer class="footer mt-auto py-3 bg-light">
    <div class="container">
        <span class="text-muted">&copy; 2024 校友交流系统</span>
    </div>
</footer>

<!-- 引入Bootstrap JS -->
<script src="asset/bootstrap-5.3.0-alpha1-dist/js/bootstrap.bundle.min.js"></script>
<script src="asset/js/echarts.js"></script>
<script>
    var chartDom = document.getElementById('memoryWall');
    var myChart = echarts.init(chartDom);

    var data = [
        {title: '校园生活', content: '这是我们一起度过的美好时光。'},
        {title: '毕业典礼', content: '那是一个充满泪水和欢笑的日子。'},
        {title: '运动会', content: '每年的运动会都是我们最期待的活动之一。'}
    ];

    var option = {
        tooltip: {},
        xAxis: {
            type: 'category',
            show: false
        },
        yAxis: {
            type: 'category',
            show: false
        },
        series: [{
            type: 'custom',
            renderItem: function (params, api) {
                var categoryIndex = api.value(0);
                var item = data[categoryIndex];

                var containerWidth = params.coordSys.width;
                var containerHeight = params.coordSys.height;

                var cardWidth = 300;
                var cardHeight = 150;
                var padding = 20;

                var x = Math.random() * (containerWidth - cardWidth);
                var y = Math.random() * (containerHeight - cardHeight);

                return {
                    type: 'group',
                    children: [{
                        type: 'rect',
                        shape: {
                            x: x,
                            y: y,
                            width: cardWidth,
                            height: cardHeight
                        },
                        style: {
                            fill: '#fff',
                            stroke: '#333',
                            lineWidth: 1,
                            shadowBlur: 8,
                            shadowOffsetX: 2,
                            shadowOffsetY: 2,
                            shadowColor: 'rgba(0,0,0,0.2)'
                        }
                    }, {
                        type: 'text',
                        style: {
                            x: x + padding,
                            y: y + padding,
                            text: item.title,
                            fill: '#333',
                            font: 'bold 16px Arial'
                        }
                    }, {
                        type: 'text',
                        style: {
                            x: x + padding,
                            y: y + padding + 30,
                            text: item.content,
                            fill: '#666',
                            font: '14px Arial',
                            width: cardWidth - padding * 2
                        }
                    }]
                };
            },
            data: data.map(function (item, index) {
                return [index];
            })
        }]
    };

    if (option && typeof option === 'object') {
        myChart.setOption(option);
    }

    window.addEventListener('resize', function() {
        myChart.resize();
    });
</script>

<script>
    var chartDom = document.getElementById('timeline');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        baseOption: {
            timeline: {
                axisType: 'category',
                orient: 'horizontal',
                autoPlay: true,
                inverse: false,
                playInterval: 1000,
                left: 'center',
                bottom: 'bottom',
                symbol: 'circle',
                symbolSize: 10,
                label: {
                    show: true,
                    interval: 'auto',
                    formatter: function (value) {
                        return value;
                    }
                },
                data: ['1903', '1951', '1978', '1998', '2003', '2018', '2023'],
                controlStyle: {
                    showPlayBtn: true,
                    showPrevBtn: true,
                    showNextBtn: true,
                    itemSize: 22,
                    itemGap: 30
                }
            },
            options: [
                {
                    title: {
                        text: '湖南农业大学历史时间线',
                        left: 'center',
                        top: 'center',
                        textStyle: {
                            fontSize: 30
                        }
                    },
                    series: [
                        {
                            type: 'bar',
                            data: []
                        }
                    ]
                }
            ]
        },
        options: [
            { // 1903年
                series: [{ data: [100] }],
                title: { subtext: '1903年 - 成立', subtextStyle: { fontSize: 24, color: 'red' } }
            },
            { // 1951年
                series: [{ data: [200] }],
                title: { subtext: '1951年 - 更名为湖南农学院', subtextStyle: { fontSize: 24, color: 'blue' } }
            },
            { // 1978年
                series: [{ data: [300] }],
                title: { subtext: '1978年 - 恢复招生', subtextStyle: { fontSize: 24, color: 'green' } }
            },
            { // 1998年
                series: [{ data: [400] }],
                title: { subtext: '1998年 - 更名为湖南农业大学', subtextStyle: { fontSize: 24, color: 'purple' } }
            },
            { // 2003年
                series: [{ data: [500] }],
                title: { subtext: '2003年 - 百年校庆', subtextStyle: { fontSize: 24, color: 'orange' } }
            },
            { // 2018年
                series: [{ data: [600] }],
                title: { subtext: '2018年 - 成为双一流建设高校', subtextStyle: { fontSize: 24, color: 'brown' } }
            },
            { // 2023年
                series: [{ data: [700] }],
                title: { subtext: '2023年 - 某重大事件', subtextStyle: { fontSize: 24, color: 'pink' } }
            }
        ],
        color: ['#3398DB'], // 进度条颜色
        barWidth: '60%', // 进度条宽度
        barGap: '-100%', // 进度条之间的间隙
        xAxis: {
            show: false
        },
        yAxis: {
            show: false
        }
    };

    option && myChart.setOption(option);
</script>


</body>
</html>

